home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / term / trms20e.lha / RexxFiles.lha / eyecandy.trx next >
Text File  |  1995-01-28  |  1KB  |  47 lines

  1. /* eyecandy.trx - 7/3/93 */
  2.  
  3. /*
  4. **    This is a simple ARexx script to demonstrate
  5. ** primarily how to parse the DISPLAY option command for
  6. ** determining the size of Terminus display screen.
  7. */
  8.  
  9. options failat 10
  10. options results
  11. signal on error
  12.  
  13. 'cursorpos = off'
  14. 'palette = color'
  15.  
  16. /* open a maximum sized display */
  17. 'display = ilace 16 color -1 -1' 
  18.  
  19. /* now get the actual size of the new display screen */
  20. 'display'
  21. parse var result lace colors temp rows cols
  22. colors = colors - 1
  23. rows = rows - 1
  24. cols = cols - 1
  25. 'cursor = off'
  26.  
  27. /* 100,000 iterations should do it */
  28. do i = 0 to 100000
  29.    tp = random(0,colors)
  30.    bp = random(0,colors)
  31.    r = random(1,rows)
  32.    c = random(1,cols)
  33.    x = random(33,125);
  34.    'move ' r ',' c
  35.    'tpen = ' tp
  36.    'bpen = ' bp
  37.    if x = 34 then 'print local "\042";'       /* escape the '"' character */
  38.    else if x = 92 then 'print local "\134";'  /* escape the '\' character */
  39.    else if x = 94 then 'print local "\136";'  /* escape the '^' character */
  40.    else 'print local "'d2c(x)'";'             /* send it */
  41.    end
  42.  
  43. exit 
  44.  
  45. error:
  46.    'print local "Error detected!"'
  47.